package dual;

import java.awt.Color;
import java.awt.Graphics;

import sample.Edge;
import sample.Vertex;
import triangulation.Polygon;

public class Guard
{
	public String name;
	public Vertex position;
	public Polygon guardedPolygon;
	public Edge guardEdge;

	public Guard()
	{
		position = null;
		guardedPolygon = null;
		name = "";
	}

	public Guard(Vertex position, Polygon guardedPolygon, String name, Edge e)
	{
		this.position = position;
		this.guardedPolygon = guardedPolygon;
		this.name = name;
		this.guardEdge = e;
	}

	@Override
	public String toString()
	{
		return name + " positioned at: " + guardEdge + " guards" + guardedPolygon;
	}

	public void draw(Graphics g, Color c)
	{
		g.setColor(Color.BLACK);
		g.fillOval(this.position.getX() - 7, this.position.getY() - 7, 14, 14);
		
		g.setColor(c);
		g.fillOval(this.position.getX() - 5, this.position.getY() - 5, 10, 10);
		
		g.setColor(Color.BLACK);
		g.drawString(name, this.position.getX() - 7, this.position.getY() - 7);
		

	}
}
